package org.atovio.structure.map;

/**
 * 树映射元素类
 * @author AtoVio, Winter Yuan
 * @version 1.0
 */
public class SortedKeyValue<K extends Comparable<? super K>, V>
        extends KeyValue<K, V> implements Comparable<SortedKeyValue<K,V>>{

    public SortedKeyValue(K key, V value) {
        super(key, value);
    }

    /**
     * 比较映射元素大小
     * @param kv the object to be compared.
     * @return
     */
    @Override
    public int compareTo(SortedKeyValue<K, V> kv) {
        return this.key.compareTo(kv.key);
    }
}
